                
                <section class="row">
                    <div class="col-12">
                        <div>
                            <h1><?= $template['title'] ?></h1>
                        </div>
                        <div>
                            <?= $this->breadcrumb->output(); ?>
                        </div>
                    </div>
                </section>

                <div class="ajax-container">
                    
                    <section class="row">
                        <div class="col-12">
                            <div class="panel panel-default">
                                <div class="panel-heading">
                                    <h2 class="panel-title"><?= $template['title'] ?></h3>
                                </div>
                                <div class="panel-body form-container">
                                    <?php if(isset($template['partials']['notifications'])) echo $template['partials']['notifications']; ?>
                                    <form id="user-form" method="post" action="<?= base_url() ?>users/<?= $action ?>" class="form-bordered form-horizontal">
                                        <fieldset>
                                            <legend><?= $template['title'] ?></legend>
                                            <ul>
                                                <li class="form-group row{photo-status}">
                                                    <label for="photo" class="control-label col-3">
                                                        Photo
                                                        <br><small>(User Photo)</small>
                                                    </label>
                                                    <div class="control-group col-9">
                                                        <div class="input-size">
                                                            <div class="fileinput fileinput-new" data-provides="fileinput">
                                                                <div class="fileinput-new thumbnail" style="width: 200px; height: 150px;">
                                                                    <img src="<?= $photo_image ?>" data-src="<?= $photo_image ?>" alt="Image Preview">
                                                                </div>
                                                                <div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 200px; max-height: 150px;"></div>
                                                                <div>
                                                                    <span class="btn btn-default btn-file"><span class="fileinput-new">Select image</span><span class="fileinput-exists">Change</span><input name="photo" id="photo" type="file"></span>
                                                                    <a href="#" class="btn btn-default fileinput-exists" data-dismiss="fileinput">Remove</a>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </li>
                                                <li class="form-group row{first-name-status}">
                                                    <label for="first-name" class="control-label col-3">
                                                        First Name *
                                                        <br><small>(Mark Angelo)</small>
                                                    </label>
                                                    <div class="control-group input-center col-9">
                                                        <div class="input-size col-12">
                                                            <div class="input-group">
                                                                <span class="input-group-addon"><i class="fa fa-user"></i></span>
                                                                <input type="text" name="first-name" id="first-name" class="form-control" placeholder="Mark Angelo" value="<?= $first_name ?>">
                                                            </div>
                                                            <?= form_error('first-name') ?>
                                                        </div>
                                                    </div>
                                                </li>
                                                <li class="form-group row{last-name-status}">
                                                    <label for="last-name" class="control-label col-3">
                                                        Last Name *
                                                        <br><small>(Angulo)</small>
                                                    </label>
                                                    <div class="control-group input-center col-9">
                                                        <div class="input-size col-12">
                                                            <div class="input-group">
                                                                <span class="input-group-addon"><i class="fa fa-user"></i></span>
                                                                <input type="text" name="last-name" id="last-name" class="form-control" placeholder="Angulo" value="<?= $last_name ?>">
                                                            </div>
                                                            <?= form_error('last-name') ?>
                                                        </div>
                                                    </div>
                                                </li>
                                                <li class="form-group row{username-status}">
                                                    <label for="username" class="control-label col-3">
                                                        Username *
                                                        <br><small>(markangeloangulo)</small>
                                                    </label>
                                                    <div class="control-group input-center col-9">
                                                        <div class="input-size col-12">
                                                            <div class="input-group">
                                                                <span class="input-group-addon"><i class="fa fa-user"></i></span>
                                                                <input type="text" name="username" id="username" class="form-control" placeholder="markangeloangulo" value="<?= $username ?>">
                                                            </div>
                                                            <?= form_error('username') ?>
                                                        </div>
                                                    </div>
                                                </li>
                                                <li class="form-group row{email-status}">
                                                    <label for="email" class="control-label col-3">
                                                        Email *
                                                        <br><small>(markangeloangulo@gmail.com)</small>
                                                    </label>
                                                    <div class="control-group input-center col-9">
                                                        <div class="input-size col-12">
                                                            <div class="input-group">
                                                                <span class="input-group-addon"><i class="fa fa-envelope-o"></i></span>
                                                                <input type="text" name="email" id="email-validation" class="form-control" placeholder="markangeloangulo@gmail.com" value="<?= $email ?>">
                                                            </div>
                                                        </div>
                                                        <?= form_error('email') ?>
                                                    </div>
                                                </li>
                                                <li class="form-group row{password-status}">
                                                    <label for="password-validation" class="control-label col-3">
                                                        Password *
                                                        <br><small>(777ang3lo)</small>
                                                    </label>
                                                    <div class="control-group col-9">
                                                        <div class="input-size">
                                                            <div class="input-group">
                                                                <span class="input-group-addon"><i class="fa fa-lock"></i></span>
                                                                <input type="password" name="password" id="password" class="form-control" placeholder="777ang3lo">
                                                            </div>
                                                        </div>
                                                        <?= form_error('password') ?>
                                                    </div>
                                                </li>
                                                <li class="form-group row{confirm-password-status}">
                                                    <label for="confirm-password-validation" class="control-label col-3">
                                                        Confirm Password *
                                                        <br><small>(type password again)</small>
                                                    </label>
                                                    <div class="control-group col-9">
                                                        <div class="input-size">
                                                            <div class="input-group">
                                                                <span class="input-group-addon"><i class="fa fa-unlock"></i></span>
                                                                <input type="password" name="confirm-password" id="confirm-password" class="form-control" placeholder="retype password">
                                                            </div>
                                                        </div>
                                                        <?= form_error('confirm-password') ?>
                                                    </div>
                                                </li>

                                                <?php if ($add) : ?>
                                                <li class="form-group row">
                                                    <label for="add-another" class="control-label col-3">
                                                        Add Another
                                                        <br><small>(Clear Form After Add)</small>
                                                    </label>
                                                    <div class="control-group col-9">
                                                        <div class="input-size">
                                                            <div class="checkbox">
                                                                <label class="control-label">
                                                                    <input type="checkbox" name="add-another" id="add-another" value="yes"<?= $add_another ?>> 
                                                                    <small>Do Not Redirect.</small>
                                                                </label>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </li>
                                                <?php endif; ?>
                                            </ul>
                                        </fieldset>
                                        <div class="submit-group col-12 align-right">
                                            <input type="hidden" name="id" id="id" value="<?= $id ?>">
                                            <button type="submit" name="submit" class="btn btn-primary"><i class="fa fa-save"></i> Save</button>
                                            <a href="<?= base_url() ?>users" class="btn btn-default"><i class="fa fa-times"></i> Cancel</a>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </section>
                <!-- page-script -->
                <script src="<?= base_url() ?>js/users/users/user_form.js"></script>
                </div>